// //打包配置文件
if (process.env.VUE_APP_PLATFORM == 'h5') {
	module.exports = {
		productionSourceMap: false,
		chainWebpack: config => {
			// 移除 prefetch 插件
			config.plugins.delete('prefetch')
			// 移除 preload 插件
			config.plugins.delete('preload')

		},
		configureWebpack: config => {
			// 公共代码抽离
			config.optimization = {
				splitChunks: {
					cacheGroups: {
						vendor: {
							chunks: 'all',
							test: /node_modules/,
							name: 'vendor',
							minChunks: 1,
							maxInitialRequests: 5,
							minSize: 0,
							priority: 100
						},
						common: {
							chunks: 'all',
							test: /[\\/]src[\\/]js[\\/]/,
							name: 'common',
							minChunks: 2,
							maxInitialRequests: 5,
							minSize: 0,
							priority: 60
						},
						styles: {
							name: 'styles',
							test: /\.(sa|sc|c)ss$/,
							chunks: 'all',
							enforce: true
						},
						runtimeChunk: {
							name: 'manifest'
						}
					}
				}
			}
		},
	};
}